﻿@using QqhrCitizen.Models
@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    EBook book = ViewBag.EBook as EBook;
    ViewBag.Title = book.Title;
}

<div>
    <div class="result-title">
        <h1 class="head-tietle">@book.Title 修改电子书</h1>
    </div>
    @using (Html.BeginForm("EBookEdit", "Admin", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.AntiForgerySID()
        <input type="hidden" value="@book.ID" name="ID" />
        <table class="detail-table">
            <tr>
                <td class="row-title">一级分类</td>
                <td>
                    <select name="oneType" class="textbox w-3" id="lsOneType">
                        <option value="0">选择分类</option>
                        @foreach (var item in ViewBag.Types)
                        {
                            <option value="@item.ID" @(book.TypeDictionary.FatherID == item.ID ? "selected" : "")>@item.TypeValue</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="row-title">二级分类</td>
                <td>
                    <select name="EBookTypeID" class="textbox w-3" id="lsSecondType">
                        @foreach (var item in ViewBag.Second)
                {
                            <option value="@item.ID" @(book.TypeDictionary.ID == item.ID ? "selected" : "")>@item.TypeValue</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td class="row-title">标题</td>
                <td><input type="text" name="Title" class="textbox w-3" value="@book.Title" /></td>
            </tr>
            <tr>
                <td class="row-title">
                    描述
                </td>
                <td>
                    <textarea class="textbox w-3" style="height:100px" rows="10" name="Description">@book.Description</textarea>
                </td>
            </tr>

            <tr>
                <td class="row-title">电子书文件</td>
                <td> 
                    <input type="file" name="file" value="@book.File.FileName" />（不修改，请留空）
                </td>
            </tr>
        </table>
        <p><input type="submit" value="保存" class="button blue" /></p>
    }
</div>








